<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html>
 <head>
    <title>其他出库单选择</title>
    <!-- import css and js -->
	<%@ include file="/common/meta.jsp" %>
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript">
		var basic_Url="${ctx}/public/windowalert";
		var show_Width=950;
		var show_Hight=400;
		var user='${user.name}';
		var grid='';
		var zdType ='${zdType}';
		$(function(){
			grid = $("#table1").ligerGrid({
		        columns: [{ display: '出入库单id', name: 'zd001Id', hide: true },
		                  { display: '出入库单号', name: 'zd001Code', width: 120 },
		                  { display: '出入库id', name: 'zd002WhId', hide: true },
		                  { display: '出入库code', name: 'zd001WhCode', hide: true },
		                  { display: '出入库仓库', name: 'zd002WhName', width: 120},
		                  { display: '客户/供应商id', name: 'zd004CompId', hide: true },
		                  { display: '客户/供应商code', name: 'zd004CompCode', hide: true },
		                  { display: '客户/供应商', name: 'zd004CompName', width: 120},
		                  { display: '单据类型', name: 'zd006BillType', width: 140, render : function(item){
		                	  if(item.zd006BillType=='PCSW'){
		                		  return '采购入库';
		                	  }else if(item.zd006BillType=='GWHN'){
		                		  return '其他入库';
		                	  }else if(item.zd006BillType=='GWHO'){
		                		  return '其他出库';
		                	  }else if(item.zd006BillType=='GWMO'){
		                		  return '材料(领料)出库';
		                	  }else if(item.zd006BillType=='GPSI'){
		                		  return '成品入库';
		                	  }else if(item.zd006BillType=='GPSO'){
		                		  return '成品出库';
		                	  }else if(item.zd006BillType=='BI'){
		                		  return '分PI录入';
		                	  }
		                  }},
		                  { display: 'pi编号', name: 'zd005PiCode', width: 120},
		                  { display: '出入库时间', name: 'zd003Date', width: 100,
		                	  render: function (item){
		                		  var cdate=new Date(item.zd003Date);
		                		  return formatDate(cdate,"yyyy-MM-dd");
		                	  }
		                  }
		                  ],  usePager: true,pageSize:30,
		                      url : basic_Url+"/billTypeSelList.do?zdType="+zdType,
		                      width: '100%', height: '98%', checkbox: true,rownumbers:true,
		                      enabledSort:false
		                  });
			$("#pageloading").hide();
		});
		function createSearch(){
			init(1,8,'100,100,100,100,100,100,100,100','30%');
			//第一行的数据
			addCommon(0,0,"lable","出入库单号");
			addCommon(0,1,"txtlike","gs.zd001Code");
			addCommon(0,2,"lable","出库仓库：");
			addCommon(0,3,"selectEnum","gs.zd002WhCode","<option></option><c:forEach var='s' items='${whList}'><option value='${s.zd002Code}'>${s.zd003Name}</option></c:forEach>");
			addCommon(0,4,"lable","单据类型");
			addCommon(0,5,"selectEnum","gs.zd006BillType","<option></option><option value='PCSW'>采购入库</option>"+
					"<option value='GWHN'>其他入库</option><option value='GWHO'>其他出库</option>"+
					"<option value='GWMO'>材料(领料)出库</option><option value='GPSI'>成品入库</option>"+
					"<option value='GPSO'>成品出库</option>");
		}
		function searchAP(){			
			multipleSearch("#table1",true,"",basic_Url+"/billTypeSelList.do?zdType="+zdType);
		}
		document.onkeydown=keyListener;   
		function keyListener(e){   
		    e = e ? e : event;  
		    if(e.keyCode == 13){   
		    	searchAP();
		    }   
		}  
		function getSelected(){
			return grid.getSelectedRows();
		}
		function Close(){
			CloseDialog();
		}
	</script>
  </head>
<body onload="createSearch()">
   <div id="layout1">
          <div id="pageHeader" class="pageHeader">
               <div class="searchBar" id="multipleSearchDialog">
	                <table class="table" width="100%" id="searchHeader" >  
                        <tbody id="newbody">
                        </tbody>
 	                </table>
                    <div class="subBar">
			             <ul>
				             <li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="searchAP()">查询</button></div></div></li>
				             <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
			             </ul>
	                </div>
               </div>
          </div>
      </div>
      <div position="center" id="table1">
      </div>
      <div class="clear"></div>
   </div>
 
</body>
</html>